package cn.anecansaitin.whimsy.generator.register;

import cn.anecansaitin.whimsy.Whimsy;
import cn.anecansaitin.whimsy.generator.assets.ModLangProvider;
import cn.anecansaitin.whimsy.generator.data.loot.modifier.ModLootModifierProvider;
import net.minecraft.data.DataProvider;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.data.event.GatherDataEvent;

@Mod.EventBusSubscriber(modid = Whimsy.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModGenerator {
    @SubscribeEvent
    public static void generator(GatherDataEvent event) {
        //全局战利品表修改（loot table）
        event.getGenerator().addProvider(event.includeServer(), (DataProvider.Factory<ModLootModifierProvider>) output -> new ModLootModifierProvider(output, Whimsy.MODID));
        //本地化文件（lang）
        event.getGenerator().addProvider(event.includeClient(), (DataProvider.Factory<ModLangProvider>) ModLangProvider.ZhCn::new);
        event.getGenerator().addProvider(event.includeClient(), (DataProvider.Factory<ModLangProvider>) ModLangProvider.EnUs::new);
    }
}
